import PropTypes from "prop-types"
import React, { memo } from "react"
import { RightOutlined } from '@ant-design/icons'

import { FooterWrapper } from "./style"
import classNames from "classnames"
import { useNavigate } from "react-router-dom"


const SectionFooter = memo((props) => {
  const { currentCity } = props

  const navigate = useNavigate()
  const toMore = () => {
    navigate("/more")
  }
  return (
    <FooterWrapper>
      <div className={classNames('text',{'text-v2': currentCity,'text-v1':!currentCity})} onClick={toMore}>
        {currentCity ? `显示更多${currentCity}房源` : '显示全部' }
        <RightOutlined />
      </div>
    </FooterWrapper>
  )
});

SectionFooter.propTypes = {
  currentCity: PropTypes.string
}

export default SectionFooter
